package day02;

import java.util.Scanner;

public class HomeWorld {
    public static void main(String[] args) {
        Scanner scan =new Scanner(System.in);
        int num =(int)(Math.random()*1000+1);
        System.out.println(num);

        int guess;
        do{
            System.out.println("请输入您猜的数字");
            guess=scan.nextInt();
            if (guess>num);{
                System.out.println("猜大了");
            }

        }while (guess!=num);




       /* int guess =scan.nextInt();
        while (guess!=num){
            if (guess>num){
                System.out.println("猜大了");
            }else {
                System.out.println("猜小了");
            }
            System.out.println("继续猜");
            guess=scan.nextInt();
        }
        System.out.println("猜对了");*/


     /*   int time=0;
        while (time<5){
            System.out.println("失败是成功的阶梯");
            time++;
        }

        int num=1;
        while (num<10){
            System.out.println(num+"*9="+(num*9));
            num+=2;
        }

      */

     /*
        Scanner scan =new Scanner(System.in);
        System.out.println("请选择业务功能：1.存款 2.取款 3.退卡");
        int command =scan.nextInt();
        switch (command){
            case 1:
                System.out.println("存款");
            case 2:
                System.out.println("取款");
            case 3:
                System.out.println("退卡");
                break;//跳出switch
            default:
                System.out.println("输入错误");
        }

         */


      /*  //Scanner演示
        Scanner scan=new Scanner(System.in);
        System.out.println("请输入年龄");
        int age=scan.nextInt();
        System.out.println("您的年龄为"+age);
        double price =scan.nextDouble();
        System.out.println("商品价格为"+price);

       */
  /* int a=9;
        if(a%2==0){
            System.out.println(a+"是偶数");
        }
        System.out.println("继续执行");

        double price =400;
        if (price>=500){
            price=price*0.8;
        }
        System.out.println("最终消费金额为"+price);

        double score=123;
        if (score>=0&&score<=100){
            System.out.println("成绩合法");
        }
        System.out.println("继续执行");

        if (a%2==0){
            System.out.println(a+"是偶数");
        }else {
            System.out.println(a+"是奇数");
        }

        if (price>=500){
            price=price*0.8;
        }else {
            price=price*0.9;
        }
        System.out.println("最终消费金额为"+price);

        */
  /* int num =10;
    int flag =num>11?1:-1;
        System.out.println(flag);

        int a=8,b=30;
        int max= a>b?a:b;
        System.out.println("max="+max);

        int c=100,d=123;
        int least=c<d?c:d;
        System.out.println(least);

    */
    }
}
